﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Popup.Master" AutoEventWireup="true"
    CodeBehind="BuildingQuery.aspx.cs" Inherits="PromotionEngine.BuildingQuery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('#txtQuery').text('<%=Request.QueryString["Query"]%>');
        });
        function UpdateQuery() {
            var query = $('#txtQuery').val();
            parent.ChooseQuery(query);
        }
    </script>
    <table style="width: 100%;">
        <tr>
            <td>
                <textarea rows="18" name="txtQuery" id="txtQuery" required="required" validationmessage="Pls input query string."
                    class="k-textbox" style="width: 100%;"> </textarea>
            </td>
        </tr>
        <tr>
            <td align="right">
                <hr />
                <button type="button" id="btnSave" class="k-button k-button-icontext k-primary" style="width: 120px;">
                    <span class="k-icon k-i-tick"></span>Test</button>
                <button type="button" id="btnCreateNew" onclick="UpdateQuery();" class="k-button k-button-icontext k-primary"
                    style="width: 120px;">
                    <span class="k-icon k-update"></span>OK</button>
            </td>
        </tr>
    </table>
</asp:Content>
